package ar.com.fiuba.ElectronicCircuitAnalyst.domain.specs;

import ar.com.fiuba.ElectronicCircuitAnalyst.domain.api.Component;
import ar.com.fiuba.ElectronicCircuitAnalyst.domain.common.Specification;

public class ComponentLeadsQtyDemuxSpecification implements Specification<Component> {

	/**
	 * Demux (special type of Components) must have at least 1 input and 1 output. 
	 * (The outputs are not limited).
	 */
	public Boolean isSatisfiedBy(Component component) {
		int inputs = component.getInputLeads().size();
		int outputs = component.getOutputLeads().size();
		
		return inputs > 0 && outputs > 0;
	}
}
